home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
C
/
LIB
/
UNIXLIB37B
/
!UnixLib37
/
src
/
c
/
strcpy
< prev
next >
Wrap
Text File
|
1996-11-09
|
845b
|
46 lines
/****************************************************************************
*
* $Source: /unixb/home/unixlib/source/unixlib37/src/c/RCS/strcpy,v $
* $Date: 1996/04/19 21:26:42 $
* $Revision: 1.1 $
* $State: Rel $
* $Author: simon $
*
* $Log: strcpy,v $
* Revision 1.1 1996/04/19 21:26:42 simon
* Initial revision
*
***************************************************************************/
static const char rcs_id[] = "$Id: strcpy,v 1.1 1996/04/19 21:26:42 simon Rel $";
#include <string.h>
char *
strcpy (char *s, register const char *s2)
{
register char *s1 = s;
while (*s1++ = *s2++);
return (s);
}
char *
strncpy (char *s, register const char *s2, register size_t n)
{
register char *s1 = s;
while (n--)
if (!(*s1++ = *s2++))
{
while (n--)
*s1++ = 0;
return (s);
}
return (s);
}